@extends(Request::ajax() ? 'layouts.partial' : 'layouts.app')
@section('content')

<script type='text/javascript'>
$(function() {
    $('#item_category_id').change(function() {
       $.get('/item_types_select', {item_category_id: $(this).val()}, function(data) {
          $('#item_type_id')
           .empty()
           .append(data);
       });
    });
});
</script>

  {{ Form::open(array('url' => '/lots', 'method'=>'post')) }}

  <div class="form-group">
    {{ Form::label('item_category_id', 'Category') }}
    {{ Form::select('item_category_id', $item_categories, Input::old('item_category_id')) }}
  </div>

  <div class="form-group">
    {{ Form::label('item_type_id', 'Type') }}
    {{ Form::select('item_type_id', $item_types, Input::old('item_type_id')) }}
  </div>

  <div class="form-group">
    {{ Form::label('container_id', 'Container') }}
    {{ Form::select('container_id', $containers, Input::old('container_id')) }}
  </div>

  <div class="form-group">
    {{ Form::label('qty', 'Qty') }}
    {{ Form::text('qty', Input::old('qty') ? Input::old('qty') : 1, array ('class'=>'form-control', 'type'=>'number')) }}
  </div>

  <div class="form-group">
    {{ Form::label('product_date', 'Product Date') }}
    {{ Form::text('product_date', Input::old('product_date') ? Input::old('product_date') : date('m/d/y'), array ('class'=>'form-control')) }}
  </div>

  <div class="form-group">
    {{ Form::label('pounds_per_item', 'Pounds per Item') }}
    {{ Form::text('pounds_per_item', Input::old('pounds_per_item'), array ('class'=>'form-control')) }}
  </div>

<br />
  {{ Form::submit('check in', array('class' => 'button')) }}
&nbsp; <a href='/lots' class='button alert'>cancel</a>
{{ Form::close() }}

@stop